package com.ibeetl.codestory.core.ast;

import com.ibeetl.codestory.core.symbol.ClazzSymbolUtil;
import com.ibeetl.codestory.core.type.Type;

import java.util.HashSet;
import java.util.Set;

/**
 * 记录方法或者变量类型，以及被引用情况
 */
public class TypedAst extends Ast {
	Type type;
	Set<Ast> used;
	public TypedAst(Token token) {
		super(token);
	}
	public Type getType(){
		return type;
	}

	public void setType(Type type) {
		this.type = type;

	}

	public void usedBy(Ast ast){
		if(used==null){
			used = new HashSet<>();
		}
		used.add(ast);
	}
}
